
import java.rmi.Naming;

import java.rmi.registry.LocateRegistry;

import S.data.courseManageData.courseManage;
import S.data.frameData.frameData;
import S.data.selectCourseData.courseSelect;
import S.data.userData.userData;

import S.dataS.*;
import S.dataS.courseManageDataService.CourseManageDataService;
import S.dataS.frameDataService.FrameDataService;
import S.dataS.selectCourseDataService.SelectCourseDataService;
import S.dataS.userDataService.UserDataService;



public class main {

	/**
	 * @param args
	 * @throws MalformedURLException 
	 * @throws AlreadyBoundException 
	 */
	public static void main(String[] args)  {
		// TODO Auto-generated method stub

		try {
			 LocateRegistry.createRegistry(6000);  
			 LocateRegistry.createRegistry(6100);  
			 LocateRegistry.createRegistry(6200);  
			 LocateRegistry.createRegistry(6300);  
			
			 UserDataService ud = new userData();
			 Naming.rebind("rmi://127.0.0.1:6000/UserDataService",ud); 
			 
			 CourseManageDataService cmd= new courseManage();
			 Naming.rebind("rmi://127.0.0.1:6100/CourseManageDataService",cmd); 
			
			 SelectCourseDataService scd = new courseSelect();
			 Naming.rebind("rmi://127.0.0.1:6200/SelectCourseDataService",scd);
			 FrameDataService fd=new frameData();
			 Naming.rebind("rmi://127.0.0.1:6300/FrameDataService",fd);
			 System.out.println("server start!");

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
